/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package otcapp.experto.decoradores;

import java.util.logging.Level;
import java.util.logging.Logger;
import otcapp.dto.SupervisionDTO;
import otcapp.experto.ExpertoSupervisiones;
import otcapp.experto.excepciones.ExpertoSupervisionesException;
import persistencia.Conexion;

/**
 *
 * @author diego
 */
public class ExpertoSupervisionesDecorador extends ExpertoSupervisiones{

    @Override
    public void crearNuevaSupervision(SupervisionDTO dtoSupervision) throws ExpertoSupervisionesException{
        try {
            Conexion.getInstancia().iniciarTX();
            super.crearNuevaSupervision(dtoSupervision);
            Conexion.getInstancia().confirmarTx();
        } catch (ExpertoSupervisionesException ex) {
            Conexion.getInstancia().deshacerTx();
            throw ex;
        }
    }
    
}
